<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Animal(name){
            this.name = name;
        }
        Animal.prototype.sayName = function(){
            console.log(`你好，我是${this.name}`)
        }

        Animal.prototype.sayHello = function(){
            console.log("hello!!!!!!")
        }

        function Dog(name){
            this.name = name;
        }

        Dog.prototype = new Animal();

        var dog = new Dog("旺财");
        dog.sayName();
        dog.sayHello();
    </script>
</body>
</html>